Saltar para o conteúdo principal
POST
/
toptimize
/
v1
/
rank
[Beta] Rank objects
curl --request POST \
  --url https://api.topsort.com/toptimize/v1/rank \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "ranking": [
    {
      "type": "listings",
      "slots": 3,
      "pageSize": 3,
      "page": {
        "type": "category",
        "value": "sneakers",
        "pageId": "/category/sneakers"
      },
      "opaqueUserId": "u_9ske45"
    }
  ]
}
'
{
  "results": [
    {
      "resultType": "listings",
      "results": [],
      "error": false
    }
  ]
}

Autorizações

Authorization
string
header
obrigatório

A valid API key generated in Topsort's UI.

Corpo

application/json

The context information to get the ranking, to rank organic and sponsored products.

ranking
object[]
obrigatório
Required array length: 1 - 5 elements
Exemplo:
[
{
"type": "listings",
"slots": 3,
"pageSize": 3,
"page": {
"type": "category",
"value": "sneakers",
"pageId": "/category/sneakers"
},
"opaqueUserId": "u_9ske45"
}
]

Resposta

The ranking results. The list of winners will contain at most slots entries per auction. It may contain fewer or no entries at all if there aren't enough products to fill the slots.

results
object[]
obrigatório
Required array length: 1 - 5 elements
Exemplo:
[
{
"resultType": "listings",
"results": [],
"error": false
}
]